//管理员
const Sequelize = require('sequelize')
const { mySequelize } = require('../config/index')

const User = mySequelize.define('user', {
  user_id: {
    type: Sequelize.INTEGER(11),
    allowNull: false,
    primaryKey: true,
    autoIncrement: true,
  },
  account: {
    type: Sequelize.STRING,
    allowNull: true,
    unique: true,
  },
  password: {
    type: Sequelize.STRING,
    allowNull: true,
  },
  name: {
    type: Sequelize.STRING,
    allowNull: false,
  },
  sex: {
    type: Sequelize.INTEGER,
    allowNull: true,
  },
  stu_num: {
    type: Sequelize.DOUBLE,
    allowNull: false,
  },
  faculty: {
    type: Sequelize.INTEGER,
    allowNull: true,
  },
  introduction: {
    type: Sequelize.STRING,
    allowNull: true,
  },
  status: {
    type: Sequelize.INTEGER,
    allowNull: true,
    comment: "0-在线,1-离线",
  },
  log_time: {
    type: Sequelize.DATE,
    allowNull: true,
  }
}, {
  freezeTableName: true,
  timestamps: false,
  tableName: 'user',
})

module.exports = User